<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersDiscountTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users_discount', function (Blueprint $table) {
            $table->increments('id');
            $table->string('level_name', 50)->comment('普通, vip, 钻石vip');
            $table->decimal('level_discount')->unsigned()->comment('会员折扣, 普通:1, vip:0.9, 钻石vip:0.85');
            $table->tinyInteger('state')->comment('0:禁用, 1:启用');
            $table->string('attr1', 50)->nullable();
            $table->string('attr2', 100)->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users_discount');
    }
}
